<template>
  <div class="Records-container">
    <div class="main">
      <div class="Conditional-filtering item">
        <div class="title">
          <Icon type="condition" />
          条件筛选
        </div>
        <div class="content">
          <Condition @change="getTime"></Condition>
        </div>
      </div>
      <div class="percentage-history item">
        <div class="title">
          <Icon type="history" />
          打卡记录
        </div>
        <div class="content">
          <PersonalRecords :screenTime="timesRef" :obtainWho="$attrs.obtainWho" :PersonalRecordsData="$attrs.PersonalRecordsData"></PersonalRecords>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import Icon from "@/components/Icon/index.vue";
import { ref } from "vue";
import Condition from "./Condition.vue"
import PersonalRecords from "./PersonalRecords.vue";
const timesRef = ref({
  startingTime: {
    id: 1,
    date: "",
  },
  endTime: {
    id: 2,
    date: "",
  },
})
// 获取筛选日期
function getTime(time){
  timesRef.value = {...timesRef.value,...time}
}

</script>

<style lang="less" scoped>
@import "@/styles/var.less";
@import "@/styles/mixin.less";
.Records-container {
  width: 100%;
  height: 100%;
  margin: 0 auto;
  .main {
    width: 100%;
    height: 100%;
    .title {
      font-size: 25px;
      font-weight: bold;
      margin-bottom: 10px;
      margin-left: 10px;
    }
    .content {
      width: 100%;
      background-color: @bakeground;
      backdrop-filter: blur(5px);
      box-shadow: 2px 2px 20px #626262;
      border-radius: 5px;
    }
    .item {
      padding: 10px 0;
    }
    .Conditional-filtering {
      .content {
        height: 50px;
      }
    }
    .percentage-history {
      .content {
        height: 450px;
      }
    }
  }
}
</style>